//----------------------------------------------------------------
#ifndef MINER_H
#define MINER_H
//----------------------------------------------------------------
#include "Common.h"
class Player;
class World;
#include "Engine.h"
#define TIME_BETWEEN_ACTIONS 350
#define MAX_CAPACITY 100
#define MAX_UNLOAD 9
/*
#include "FSM.h"
#include "MinerEvents.h"
#include "MinerStates.h"
*/
//----------------------------------------------------------------
class Miner
{
public:
	Miner(int iPosX, int iPosY, World* pkWorld, Player* pkPlayer);
	~Miner();

	enum MinerActions
	{
		StopActions,
		GoToMineGold,
		GoToMineStone,
		GoToMineFood,
		GoToMineWood,
		GoToBase,
	};

	void update(float fTimeBetweenFrames);
	void minerDoAction(MinerActions kAction);

	int getPosX() { return m_iPosX; }
	int getPosY() { return m_iPosY; }

private:
	int m_iPosX;
	int m_iPosY;
	ResourceList m_kResourceType;
	int m_iResourceAmount;

	vector<int> m_kCurrentPath;
	int m_iCurrentPos;
	int m_iCurrentNodePosX;
	int m_iCurrentNodePosY;

	float fTimeSinceLastAction;

	enum MinerStates
	{
		Idle,
		GoingToMine,
		GoingToBase,
		Minning,
		Unloading
	};

	MinerStates m_kCurrentState;

	World* m_pkWorld;
	Player* m_pkPlayer;

	Sprite m_pkSprite;
	void setSpritePos();

	/*
	FSM m_kStateMachine;

	Idle m_kStateIdle;
	GoingToBase m_kStateGoingToBase;
	GoingToMine m_kStateGoingToMine;
	Minning m_kStateMinning;
	Unloading m_kStateUnloading;

	GoToMine m_kEventGoToMine;
	GoToBase m_kEventGoToBase;
	Mine m_kEventMinning;
	Unload m_kEventUnload;
	StopActions m_kEventStopActions;
	*/
//----------------------------------------------------------------
friend class Player;
//----------------------------------------------------------------
};
//----------------------------------------------------------------
#endif //MINER_H
//----------------------------------------------------------------
